Skip to content

Address redundant errors for missing crate for nested imports and later uses of crate#153956

Open
yuk1ty wants to merge 2 commits into
rust-lang:mainfrom
yuk1ty:fix-redundant-import-errors-nested
Open

Address redundant errors for missing crate for nested imports and later uses of crate#153956
yuk1ty wants to merge 2 commits into
rust-lang:mainfrom
yuk1ty:fix-redundant-import-errors-nested

Conversation

@yuk1ty

@yuk1ty yuk1ty commented Mar 16, 2026

Copy link
Copy Markdown
Contributor

Fixes #153156

Basically I merged redundant E0433 errors into E0432. The change seems to affect other related tests.

The first commit handles the nested import case. The second commit handles to suppress foo::qux() pattern.

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Mar 16, 2026
@rustbot

rustbot commented Mar 16, 2026

Copy link
Copy Markdown
Collaborator

r? @dingxiangfei2009

rustbot has assigned @dingxiangfei2009.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 69 candidates
  • Random selection from 15 candidates

@rustbot

This comment has been minimized.

@yuk1ty yuk1ty marked this pull request as draft March 16, 2026 13:57
@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 16, 2026
@yuk1ty yuk1ty force-pushed the fix-redundant-import-errors-nested branch 2 times, most recently from ac89d2b to 594e22e Compare March 16, 2026 15:48
@rust-log-analyzer

This comment has been minimized.

@yuk1ty yuk1ty force-pushed the fix-redundant-import-errors-nested branch from 594e22e to 4b6cc82 Compare March 17, 2026 08:30
@rust-log-analyzer

This comment has been minimized.

@yuk1ty yuk1ty force-pushed the fix-redundant-import-errors-nested branch from 4b6cc82 to 6671a98 Compare March 17, 2026 14:14
@yuk1ty yuk1ty marked this pull request as ready for review March 18, 2026 05:32
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Mar 18, 2026
@rust-bors

This comment has been minimized.

@yuk1ty yuk1ty force-pushed the fix-redundant-import-errors-nested branch from 6671a98 to ea4f0fd Compare March 25, 2026 13:36
@rustbot

rustbot commented Mar 25, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@rust-log-analyzer

This comment has been minimized.

Track first segments of failed imports and skip late resolution errors
for paths sharing the same prefix. This avoids redundant E0433 after an
E0432 has already been reported for the same missing module, without
suppressing unrelated diagnostics.
@yuk1ty yuk1ty force-pushed the fix-redundant-import-errors-nested branch from ea4f0fd to 343fb27 Compare March 26, 2026 01:58
@rust-bors

rust-bors Bot commented Apr 28, 2026

Copy link
Copy Markdown
Contributor

☔ The latest upstream changes (presumably #155890) made this pull request unmergeable. Please resolve the merge conflicts.


mod B {
use A::{::Fish}; //~ ERROR the crate root in paths can only be used in start position
use A::{::Fish}; //~ ERROR unresolved import `A::Fish`

@Enselic Enselic Jul 3, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello. This is an unwanted regression in diagnostics, isn't it? In case you haven't looked through all diagnostic output changes and made sure they are all sensible, please do that. Thanks!

View changes since the review

@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 3, 2026
@rustbot

rustbot commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@rustbot rustbot added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Jul 3, 2026
#![allow(unused_imports)]

mod foo {}

@cjgillot cjgillot Jun 3, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is changing the purpose of the test. Please prefer creating another one.

View changes since the review

/// First segments of import paths that failed to resolve.
/// Used to suppress redundant resolution errors in late resolver
/// for paths sharing the same unresolved prefix.
failed_import_prefixes: FxHashSet<Symbol>,

@cjgillot cjgillot Jun 3, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may be sufficient for a single-file test case. What if the prefix exists in one file and not another one?

View changes since the review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Too many errors for missing crate for nested imports and later uses of crate

6 participants